﻿using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;

using Orchard.Mvc.Routes;

namespace AMC.SubstitutionCache
{
    public class Routes : IRouteProvider
    {
        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            return new[] 
            {
                new RouteDescriptor 
                {
                    Route = new Route(
                        "Admin/SubstitutionCache/{action}",
                        new RouteValueDictionary 
                        {
                            { "area", "AMC.SubstitutionCache" },
                            { "controller", "Admin" }
                        },
                        null,
                        new RouteValueDictionary 
                        {
                            { "area", "AMC.SubstitutionCache" }
                        },
                        new MvcRouteHandler())
                }
            };
        }
    }
}